<template>
  <view class="images">
    <ul class="left">
      <li
        v-for="(item,key) in images"
        v-if="key%2==1"
        :key="key"
        @click="preview(key)"
      >
        <image
          :src="item.url"
          mode="aspectFill"
        />
      </li>
    </ul>
    <ul class="right">
      <li
        v-for="(item,key) in images"
        v-if="key%2==0"
        :key="key"
        @click="preview(key)"
      >
        <image
          :src="item.url"
          mode="aspectFill"
        />
      </li>
    </ul>
  </view>
</template>

<script>
	export default {
		data() {
			return {
				images: []
			};
		},
		onLoad(e) {
			this.images = e.image.split(',').map(res => {
				return this.$getImg(res);

			});
		},
		methods: {
			preview(i) {
				uni.previewImage({
					current: i,
					urls: this.images,
					indicator: 'default'
				});
			}
		}
	};
</script>

<style lang="less" scoped>
	.images {
		overflow: hidden;
		height: 1336upx;
		background: #FFF;
		padding: 0 16upx;

		.left,
		.right {
			overflow: hidden;
			float: left;

			li {
				width: 335upx;
				height: 250upx;
				// float: left;
				margin: 20upx 0 0 20upx;

				image {
					width: 100%;
					height: 100%;
				}
			}
		}

		.right {
			li {
				height: 222upx;
			}
		}
	}
</style>
